package com.venue.hjt.venueclass.db;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.ToMany;

import java.util.List;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.DaoException;

/**
 * Created by xqx on 2018/3/14.
 *
 */
@Entity
public class VenueInfo {
    @Id
    public String id;
    public String venue_name;
    public String description;//简介
    public String min_num;//最小人数
    public String max_num;//最大人数
    public String score;//评分分数
    public String regulation;//场馆使用规定内容
    public String add_time;//场馆使用规定内容
    public String user_score;//评分分数
    @ToMany(referencedJoinProperty = "V_id")
    private List<CardStudent> students;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 2099654670)
    private transient VenueInfoDao myDao;
    @Generated(hash = 1102599977)
    public VenueInfo(String id, String venue_name, String description, String min_num, String max_num,
            String score, String regulation, String add_time, String user_score) {
        this.id = id;
        this.venue_name = venue_name;
        this.description = description;
        this.min_num = min_num;
        this.max_num = max_num;
        this.score = score;
        this.regulation = regulation;
        this.add_time = add_time;
        this.user_score = user_score;
    }
    @Generated(hash = 226996401)
    public VenueInfo() {
    }
    public String getId() {
        return this.id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getVenue_name() {
        return this.venue_name;
    }
    public void setVenue_name(String venue_name) {
        this.venue_name = venue_name;
    }
    public String getDescription() {
        return this.description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getMin_num() {
        return this.min_num;
    }
    public void setMin_num(String min_num) {
        this.min_num = min_num;
    }
    public String getMax_num() {
        return this.max_num;
    }
    public void setMax_num(String max_num) {
        this.max_num = max_num;
    }
    public String getScore() {
        return this.score;
    }
    public void setScore(String score) {
        this.score = score;
    }
    public String getRegulation() {
        return this.regulation;
    }
    public void setRegulation(String regulation) {
        this.regulation = regulation;
    }
    public String getAdd_time() {
        return this.add_time;
    }
    public void setAdd_time(String add_time) {
        this.add_time = add_time;
    }
    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 1264272552)
    public List<CardStudent> getStudents() {
        if (students == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            CardStudentDao targetDao = daoSession.getCardStudentDao();
            List<CardStudent> studentsNew = targetDao._queryVenueInfo_Students(id);
            synchronized (this) {
                if (students == null) {
                    students = studentsNew;
                }
            }
        }
        return students;
    }
    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 238993120)
    public synchronized void resetStudents() {
        students = null;
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    public String getUser_score() {
        return this.user_score;
    }
    public void setUser_score(String user_score) {
        this.user_score = user_score;
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 878425296)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getVenueInfoDao() : null;
    }

}
